﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 代码
{
    class Program
    {
        static void Main(string[] args)
        {
            /* using na      
           计算BMI身体健康指数，BMI=体重（身高*体重）
             * BMI<18.5 体重过轻
             * 18.5<=BMI<=24.9 正常范围
             * 24.9<=BMI<=29.9 体重过重
             *BMI>29.9 肥胖   
             * */
            Console.WriteLine("请输入身高(厘米)：");
            double height = Convert.ToDouble(Console.ReadLine());       
            Console.WriteLine("请输入体重(千克)：");
            int weight = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("您的体重是：" + weight + "千克");
            Console.WriteLine("您的身高是：" + height + "厘米");
            height = height / 100;
            double exponnet = weight / (height * height);
            exponnet = Math.Round(exponnet, 2);
            Console.WriteLine("BMI身体健康指数为：" + exponnet);
            Console.Write("您的体重属于：");
            if (exponnet < 18.5)
            {
                Console.WriteLine("体重过轻");
            }
            else if (exponnet >= 18.5 && exponnet <= 24.9)
            {
                Console.WriteLine("正常范围");
            }
            else if (exponnet >= 24.9 && exponnet <= 29.9)
            {
                Console.WriteLine("体重过重");
            }
            else
            {
                Console.WriteLine("肥胖");
            }
            Console.ReadKey();
        }
    }
}
